module.exports = () =>{
  return   async function hasLogin(ctx, next) {
    console.log('check_login');
    if (isNaN(ctx.session.user_id)){
      ctx.body = {
        code: 1,
        message:"没有登录"
      };
      ctx.response.status = 401;
      return;
    }
    await next();
  }
}